<template>
    <div>
        <text-picker :config="config.data[0]"/>
        <area-picker v-if="config.isArea&&isHide" :config="config.data[1]"/>
    </div>
</template>

<script>
import TextPicker from '../components/TextPicker';
import AreaPicker from '../components/AreaPicker';
export default {
    data() {
        return {
            isHide: false
        };
    },
    props: ['config'],
    components: {
        'text-picker': TextPicker,
        'area-picker': AreaPicker
    },
    watch: {
        config: {
            handler: function(val, oldVal) {
                if (val.data[0].value == '中国大陆') {
                    this.isHide = true;
                } else {
                    this.isHide = false;
                }
            },
            deep: true
        }
    }
};
</script>

<style>

</style>
